package fr.louloutes.lolshooter.engine.objects.protagonists;

import android.graphics.Rect;
import fr.louloutes.lolshooter.engine.objects.Score;
import fr.louloutes.lolshooter.engine.objects.weapons.SimplePlayerGun;
import fr.louloutes.lolshooter.engine.sprites.LolSprite;

/**
 * Class Player: player handling
 * 
 * @author Louloute
 * 
 */
public class Player extends Protagonist
{
	Score score = new Score();

	/**
	 * Constructor with initialization
	 * 
	 * @param sprite
	 */
	public Player( LolSprite sprite )
	{
		super( 20, sprite, new SimplePlayerGun() );

	}

	/**
	 * Update player position. Do nothing because position is handled with
	 * touching finger position
	 * 
	 * @param elapsedTime
	 * @param frameRect
	 */
	@Override
	public void move( long elapsedTime, Rect frameRect )
	{
		// do nothing : moves are finger directed only
	}

	/**
	 * Add to current score
	 * 
	 * @param toadd
	 */
	public void addToScore( int toadd )
	{
		score.addToScore( toadd );
	}

	/**
	 * Get current score
	 * 
	 * @return
	 */
	public int getScore()
	{
		return score.getScore();
	}

	/**
	 * Get current life
	 * 
	 * @return
	 */
	public int getLife()
	{
		return lifeBar.currentLife;
	}

	/**
	 * Get max life
	 * 
	 * @return
	 */
	public int getMaxLife()
	{
		return lifeBar.maxLife;
	}
}
